Skip to content

Auto-detect AWS Region from Config #2425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ConnorJC3
Copy link
Contributor

What type of PR is this?

/kind feature

What is this PR about? / Why do we need it?

Automatically use the local user's region from their awscli config if AWS_REGION is not present. To make this work consistently, use aws ec2 describe-availability-zones to auto-choose AZs instead of hardcoding us-west-2a through us-west-2c

How was this change tested?

$ aws configure
<set region to us-east-1>

$ make cluster/create
./hack/e2e/create-cluster.sh
Error: cluster not found "ebs-csi-e2e.k8s.local"
###
## Creating cluster ebs-csi-e2e.k8s.local with /home/conncatl/aws-ebs-csi-driver/hack/e2e/csi-test-artifacts/ebs-csi-e2e.k8s.local.kops.yaml (dry run)
#
W0328 21:13:24.186810   69189 new_cluster.go:1444] Gossip is deprecated, using None DNS instead
I0328 21:13:24.186873   69189 new_cluster.go:1463] Cloud Provider ID: "aws"
I0328 21:13:25.515392   69189 subnets.go:224] Assigned CIDR 172.20.0.0/18 to subnet us-east-1a
I0328 21:13:25.515420   69189 subnets.go:224] Assigned CIDR 172.20.64.0/18 to subnet us-east-1b
I0328 21:13:25.515427   69189 subnets.go:224] Assigned CIDR 172.20.128.0/18 to subnet us-east-1c
......
<cluster creates, see region was correctly detected>

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 28, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from connorjc3. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 28, 2025
Copy link

Code Coverage Diff

This PR does not change the code coverage

@ConnorJC3 ConnorJC3 force-pushed the autodetct-region-zones branch from a94b8d5 to 68a6dd9 Compare April 1, 2025 18:33
@ConnorJC3 ConnorJC3 force-pushed the autodetct-region-zones branch from 68a6dd9 to 09c4c0b Compare April 1, 2025 18:35
@k8s-ci-robot
Copy link
Contributor

@ConnorJC3: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-aws-ebs-csi-driver-external-test 09c4c0b link true /test pull-aws-ebs-csi-driver-external-test
pull-aws-ebs-csi-driver-external-test-arm64 09c4c0b link false /test pull-aws-ebs-csi-driver-external-test-arm64
pull-aws-ebs-csi-driver-test-helm-chart 09c4c0b link true /test pull-aws-ebs-csi-driver-test-helm-chart
pull-aws-ebs-csi-driver-test-e2e-external-eks-windows 09c4c0b link true /test pull-aws-ebs-csi-driver-test-e2e-external-eks-windows
pull-aws-ebs-csi-driver-e2e-multi-az 09c4c0b link true /test pull-aws-ebs-csi-driver-e2e-multi-az
pull-aws-ebs-csi-driver-external-test-eks 09c4c0b link true /test pull-aws-ebs-csi-driver-external-test-eks
pull-aws-ebs-csi-driver-image-test 09c4c0b link true /test pull-aws-ebs-csi-driver-image-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants